//
//  SchoolCollectionViewCell.m
//  time
//
//  Created by bingo on 2018/5/20.
//  Copyright © 2018年 1ge. All rights reserved.
//

#import "SchoolCollectionViewCell.h"
#import <Masonry/Masonry.h>

@interface SchoolCollectionViewCell ()

@end
@implementation SchoolCollectionViewCell
#pragma mark-
- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self setupUI];
        [self setupLayout];
    }
    return self;
}
#pragma mark- UI
- (void)setupUI {
    self.itemImageView = [[UIImageView alloc] init];
    self.itemImageView.contentMode = UIViewContentModeScaleToFill;
    
    self.timeLabel = [[UILabel alloc] init];
    self.timeLabel.font = [UIFont systemFontOfSize:12];
    self.timeLabel.textAlignment = NSTextAlignmentCenter;
    self.timeLabel.numberOfLines = 1;
    self.timeLabel.text = @"2018-05-20";
    
    self.titleLabel = [[UILabel alloc] init];
    self.titleLabel.font = [UIFont systemFontOfSize:13];
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    self.titleLabel.numberOfLines = 1;
    self.titleLabel.text = @" 123";
    
    self.descripLabel = [[UILabel alloc] init];
    self.descripLabel.font = [UIFont systemFontOfSize:12];
    self.descripLabel.textAlignment = NSTextAlignmentCenter;
    self.descripLabel.numberOfLines = 3;
    self.descripLabel.text = @"123456";
}
- (void)setupLayout {
    [self addSubview:self.itemImageView];
    [self.itemImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.right.offset = 0;
        make.height.offset = 80.0;
    }];
    [self addSubview:self.timeLabel];
    [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.itemImageView.mas_bottom).offset = 3;
        make.left.mas_equalTo(10);
        make.right.mas_equalTo(-10);
    }];
    [self addSubview:self.titleLabel];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(10);
        make.right.mas_equalTo(-10);
        make.top.mas_equalTo(self.timeLabel.mas_bottom).offset = 3;
    }];
    [self addSubview:self.descripLabel];
    [self.self.descripLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(10);
        make.right.mas_equalTo(-10);
        make.top.mas_equalTo(self.titleLabel.mas_bottom).offset = 3;
        make.bottom.mas_equalTo(0);
    }];
}
@end
